package com.gnerv.rabbitmq.agent.command;

import com.gnerv.rabbitmq.agent.model.entity.Node;
import com.gnerv.rabbitmq.agent.tools.ExecTools;
import com.google.common.collect.Lists;

import java.util.List;

/**
 * @author Gnerv LiGen
 */
public class PluginCommand extends AbstractRabbitmqPluginsCommand {

    public PluginCommand(Node node) {
        super();
        setNode(node);
    }

    public static PluginCommand build(Node node) {
        return new PluginCommand(node);
    }

    public ExecTools.ExecResult enable(List<String> names) {
        List<String> enable = Lists.newArrayList();
        enable.add("enable");
        enable.addAll(names);
        return run(enable);
    }

    public ExecTools.ExecResult disable(List<String> names) {
        List<String> disable = Lists.newArrayList();
        disable.add("disable");
        disable.addAll(names);
        return run(disable);
    }

    public ExecTools.ExecResult list() {
        List<String> disable = Lists.newArrayList();
        disable.add("list");
        return run(disable);
    }

}
